<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantumLibrary: Bloomberg::quantum::IContextBase Interface Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QuantumLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d1/d6e/structBloomberg_1_1quantum_1_1IContextBase-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Bloomberg::quantum::IContextBase Interface Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>This interface exposes shared functionality between <a class="el" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html" title="Exposes methods to manipulate the thread context.">IThreadContext</a> and <a class="el" href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html" title="Exposes methods to manipulate the coroutine context.">ICoroContext</a>.  
 <a href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="../../de/d24/quantum__icontext__base_8h_source.html">quantum_icontext_base.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Bloomberg::quantum::IContextBase:</div>
<div class="dyncontent">
 <div class="center">
  <img src="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.png" usemap="#Bloomberg::quantum::IContextBase_map" alt=""/>
  <map id="Bloomberg::quantum::IContextBase_map" name="Bloomberg::quantum::IContextBase_map">
<area href="../../de/d67/structBloomberg_1_1quantum_1_1ICoroContextBase.html" title="Exposes methods to manipulate the coroutine context, especially future wait methods." alt="Bloomberg::quantum::ICoroContextBase" shape="rect" coords="0,56,262,80"/>
<area href="../../da/d4d/structBloomberg_1_1quantum_1_1IThreadContextBase.html" title="Exposes methods to manipulate the thread context, especially future wait methods." alt="Bloomberg::quantum::IThreadContextBase" shape="rect" coords="272,56,534,80"/>
<area href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html" title="Exposes methods to manipulate the coroutine context." alt="Bloomberg::quantum::ICoroContext&lt; RET &gt;" shape="rect" coords="0,112,262,136"/>
<area href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html" title="Exposes methods to manipulate the thread context." alt="Bloomberg::quantum::IThreadContext&lt; RET &gt;" shape="rect" coords="272,112,534,136"/>
<area href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html" title="Concrete class representing a coroutine or a thread context." alt="Bloomberg::quantum::Context&lt; RET &gt;" shape="rect" coords="0,168,262,192"/>
<area href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html" title="Concrete class representing a coroutine or a thread context." alt="Bloomberg::quantum::Context&lt; RET &gt;" shape="rect" coords="272,168,534,192"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac92e5d294479f777fd01f5621e4f8db9"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#ac92e5d294479f777fd01f5621e4f8db9">Ptr</a> = std::shared_ptr&lt; <a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html">IContextBase</a> &gt;</td></tr>
<tr class="separator:ac92e5d294479f777fd01f5621e4f8db9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a39a012af6799019e99e1ab5364bb2c86"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#a39a012af6799019e99e1ab5364bb2c86">~IContextBase</a> ()=default</td></tr>
<tr class="memdesc:a39a012af6799019e99e1ab5364bb2c86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual destructor.  <a href="#a39a012af6799019e99e1ab5364bb2c86">More...</a><br /></td></tr>
<tr class="separator:a39a012af6799019e99e1ab5364bb2c86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a022df5fbd098b18058823ac74e4491d1"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#a022df5fbd098b18058823ac74e4491d1">valid</a> () const =0</td></tr>
<tr class="memdesc:a022df5fbd098b18058823ac74e4491d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the future object associated with this context has a valid shared state with the corresponding promise.  <a href="#a022df5fbd098b18058823ac74e4491d1">More...</a><br /></td></tr>
<tr class="separator:a022df5fbd098b18058823ac74e4491d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cb482148c731b5b9d6866d7e57f962f"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#a5cb482148c731b5b9d6866d7e57f962f">validAt</a> (int num) const =0</td></tr>
<tr class="memdesc:a5cb482148c731b5b9d6866d7e57f962f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if the future object associated with the 'num'-th continuation context is still valid.  <a href="#a5cb482148c731b5b9d6866d7e57f962f">More...</a><br /></td></tr>
<tr class="separator:a5cb482148c731b5b9d6866d7e57f962f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a084048c88d90de4f3797f18fb3c5fcc4"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#a084048c88d90de4f3797f18fb3c5fcc4">setException</a> (std::exception_ptr ex)=0</td></tr>
<tr class="memdesc:a084048c88d90de4f3797f18fb3c5fcc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an exception in the promise associated with the current <a class="el" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html" title="Exposes methods to manipulate the thread context.">IThreadContext</a> or <a class="el" href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html" title="Exposes methods to manipulate the coroutine context.">ICoroContext</a>.  <a href="#a084048c88d90de4f3797f18fb3c5fcc4">More...</a><br /></td></tr>
<tr class="separator:a084048c88d90de4f3797f18fb3c5fcc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This interface exposes shared functionality between <a class="el" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html" title="Exposes methods to manipulate the thread context.">IThreadContext</a> and <a class="el" href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html" title="Exposes methods to manipulate the coroutine context.">ICoroContext</a>. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="ac92e5d294479f777fd01f5621e4f8db9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac92e5d294479f777fd01f5621e4f8db9">&#9670;&nbsp;</a></span>Ptr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#ac92e5d294479f777fd01f5621e4f8db9">Bloomberg::quantum::IContextBase::Ptr</a> =  std::shared_ptr&lt;<a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html">IContextBase</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a39a012af6799019e99e1ab5364bb2c86"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39a012af6799019e99e1ab5364bb2c86">&#9670;&nbsp;</a></span>~IContextBase()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual Bloomberg::quantum::IContextBase::~IContextBase </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Virtual destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a084048c88d90de4f3797f18fb3c5fcc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a084048c88d90de4f3797f18fb3c5fcc4">&#9670;&nbsp;</a></span>setException()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Bloomberg::quantum::IContextBase::setException </td>
          <td>(</td>
          <td class="paramtype">std::exception_ptr&#160;</td>
          <td class="paramname"><em>ex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set an exception in the promise associated with the current <a class="el" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html" title="Exposes methods to manipulate the thread context.">IThreadContext</a> or <a class="el" href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html" title="Exposes methods to manipulate the coroutine context.">ICoroContext</a>. </p>
<p>When setting an exception inside a promise, any attempt to read a value from the associated future will re-throw this exception. Any threads or coroutines already blocked on this future will immediately unblock and re-throw. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ex</td><td>An exception pointer which has been caught via std::current_exception. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>

<p>Implemented in <a class="el" href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html#a5a71ccef08af22fdde662e7df560dccb">Bloomberg::quantum::Context&lt; RET &gt;</a>.</p>

</div>
</div>
<a id="a022df5fbd098b18058823ac74e4491d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a022df5fbd098b18058823ac74e4491d1">&#9670;&nbsp;</a></span>valid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool Bloomberg::quantum::IContextBase::valid </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the future object associated with this context has a valid shared state with the corresponding promise. </p>
<dl class="section return"><dt>Returns</dt><dd>True if valid, false otherwise. </dd></dl>

<p>Implemented in <a class="el" href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html#aef705383af39db02acc63c0dd8e4a321">Bloomberg::quantum::Context&lt; RET &gt;</a>.</p>

</div>
</div>
<a id="a5cb482148c731b5b9d6866d7e57f962f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cb482148c731b5b9d6866d7e57f962f">&#9670;&nbsp;</a></span>validAt()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool Bloomberg::quantum::IContextBase::validAt </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determines if the future object associated with the 'num'-th continuation context is still valid. </p>
<p>When using coroutine continuations, any future in the continuation chain can be validated using this function. Allowed range for num is [-1, total_continuations). -1 is equivalent of calling <a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#a022df5fbd098b18058823ac74e4491d1" title="Determines if the future object associated with this context has a valid shared state with the corres...">valid()</a> or validAt(total_continuations-1) on the last context in the chain (i.e. the context which is returned via <a class="el" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a3a0a83b7941b8b0cf2c0a9ce6ec0f7ab" title="This is the last method in a continuation chain.">IThreadContext::end()</a> or <a class="el" href="../../d5/dd1/structBloomberg_1_1quantum_1_1ICoroContext.html#ab2530e5e0231aaba5a2f06315f713300" title="This is the last method in a continuation chain.">ICoroContext::end()</a>). Position 0 represents the first future in the chain. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>The number indicating which future to validate. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if valid, false otherwise. </dd></dl>

<p>Implemented in <a class="el" href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html#ab23416d558addcca3ba223c3ff689672">Bloomberg::quantum::Context&lt; RET &gt;</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a></li><li class="navelem"><a class="el" href="../../dc/d48/namespaceBloomberg_1_1quantum.html">quantum</a></li><li class="navelem"><a class="el" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html">IContextBase</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
